﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Simple2DSample
{
    class CollisionSystem : List<MovingSprite>
    {

        //List<MovingSprite> _List = new  List<MovingSprite>();


        //public void AddObject(MovingSprite obj)
        //{
            
        //}

        //public void RemoveObject()
        //{
        //    _List.
        //}

        public int GetCollisionCount( MovingSprite srcObj)
        {

            int count = 0;
            foreach (MovingSprite destObj in this)
            {
                if (srcObj != destObj && srcObj.srcRect.IntersectsWith(destObj.srcRect))
                    ++count;

            }
            return count;
        }


    }
}
